<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
        + request.getContextPath() + "/";
      String code= request.getParameter("code");
      String[] codes=code.split("##");
      String obj="";
      for(int i=0;i<codes.length;i++){
          obj=obj+"&"+codes[i];
      }
     obj= obj.replace(":","=");
    String ym= request.getParameter("ym");
    ym=ym+"##"+obj;


%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <base href="<%=basePath %>">
    <script src="statics/js/login/jquery.min.js"></script>

</head>

<body style="width: 100%;height: 100%">
<input type="hidden" id="report" value="<%=ym %>">

<iframe id="reporturl" style=" width: 100%; height:1200px;frameborder:'no'">
</iframe>
</body>
</html>
<script>
    // var reporturl=getReportUrl();
    // var srcs=$("#report").val();
    // var objs=srcs.split("##");
    // var url="";
    // if(objs.length==2){
    //     url=reporturl+objs[0]+".raq"+objs[1];
    // }else{
    //     url=reporturl+objs[0]+".raq";
    // }
    //  $("#reporturl")[0].src=url;

    //润乾报表
    // var reporturl=getReportUrl();//获取系统前缀
    var reporturl="http://139.196.23.105:6868/demo/reportJsp/preview.jsp?__rpx=%2F";
    var srcs=$("#report").val();//打印报表名
    var objs=srcs.split("##");//[0]是报表名，[1]是参数
    var url="";
    if(objs.length==2){
        url=reporturl+objs[0]+".rpx&__rpxHome=C%3A%2FUsers%2FAdministrator%2FDesktop%2FTemplate&__dfxHome=C%3A%5CProgram+Files%5Craqsoft%5Creport%5Cbin"+objs[1];
    }else{
        url=reporturl+objs[0]+".rpx&__rpxHome=C%3A%2FUsers%2FAdministrator%2FDesktop%2FTemplate&__dfxHome=C%3A%5CProgram+Files%5Craqsoft%5Creport%5Cbin";
    }
    $("#reporturl")[0].src=url;
   // http://localhost:6868/demo/reportJsp/preview.jsp?__rpx=%2FbillExchange1.rpx&__rpxHome=C%3A%2FUsers%2Fceil%2FDesktop%2FTemplate&__dfxHome=D%3A%5C%E6%B6%A6%E4%B9%BE%E6%8A%A5%E8%A1%A8%5Creport%5Cbin
    http://localhost:6868/demo/reportJsp/preview.jsp?__rpx=%2FbillExchange1.rpx&__rpxHome=C%3A%2FUsers%2FAdministrator%2FDesktop%2FTemplate&__dfxHome=C%3A%5CProgram+Files%5Craqsoft%5Creport%5Cbin
    //获取字典
    function getdictionary(dl,xl) {
        var obj=[];
        $.ajax({
            type : 'POST',
            //  url : 'resource/getTree',
            data: {"type":dl,"lx":xl},
            url:'dictionary2/getValues',
            dataType:"json",
            // contentType: 'application/json',
            async:false,
            success : function (da) {
                if(da.status==200 ){
                    obj=da.data;
                }
            },
            error: function(data) {
                // layer.msg("获取失败!");
            }
        });
        return obj;
    }
    //获取报表url前缀
    function  getReportUrl() {
         var url=getdictionary(6,54);
         return url[1].name;
    }


    //自定义ceil函数
    function ROUNDUP(value,point) {
        return Math.ceil(value)
    }
</script>

